//
//  main.cpp
//  P2141
//
//  Created by 洋犀利 on 2019/9/8.
//  Copyright © 2019 洋犀利. All rights reserved.
//

#include <iostream>
using namespace std;
int many;
int nowAdd;
int num[102]={0};
bool bor;

int main(int argc, const char * argv[]) {
    int m;
    cin>>m;
    for(int i=0;i<m;i++){
        cin>>num[i];
    }
    for(int i=0;i<m;i++){
        for(int j=0;j<m;j++){
            for(int k=j;k<m;k++){
                if(num[j]+num[k]==num[i]&&num[j]!=num[k]){
                    many++;
                    bor=true;
                    break;
                }
            }
            if(bor){
                bor=false;
                break;
            }
        }
    }
    cout<<many;
    
    return 0;
}
